package util

// uint切片去重
func DeduplicationSliceUint(uts []uint) []uint {
	tmpUint := make([]uint, 0, len(uts))
	tmp := map[uint]struct{}{}
	for _, value := range uts {
		if _, ok := tmp[value]; !ok {
			tmp[value] = struct{}{}
			tmpUint = append(tmpUint, value)
		}
	}
	return tmpUint
}

// uint切片元素删除
func DeleteSliceUint(ut uint, uts []uint) []uint {
	i := 0
	for _, value := range uts {
		if value != ut {
			uts[i] = value
			i++
		}
	}
	return uts[:i]
}
